package com.seven.monior;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public final class DatabaseHelper extends SQLiteOpenHelper {
	public static final String DATABASE_NAME = "seven_monitor.db";
	public static final int DATABASE_VERSION = 9;

	DatabaseHelper(Context paramContext) {
		super(paramContext, DATABASE_NAME, null, DATABASE_VERSION);
	}

	public void onCreate(SQLiteDatabase paramSQLiteDatabase) {
		paramSQLiteDatabase
				.execSQL("CREATE TABLE apps (_id INT PRIMARY KEY, uid INT, date TIMESTAMP, pkg VARCHAR(100), is_running INT, mobile_received INT, mobile_last_received INT, mobile_sent INT, mobile_last_sent INT, total_received INT, total_last_received INT, total_sent INT, total_last_sent INT, cputime FLOAT)");
	}

	public void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1,
			int paramInt2) {
		paramSQLiteDatabase.execSQL("DROP TABLE IF EXISTS apps");
		onCreate(paramSQLiteDatabase);
	}
}